# Copyright 2010-2025 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_cc//cc:cc_library.bzl", "cc_library")

package(default_visibility = ["//visibility:public"])

cc_library(
    name = "proto_converter",
    srcs = ["proto_converter.cc"],
    hdrs = ["proto_converter.h"],
    deps = [
        "//ortools/base:status_macros",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/linear_solver:model_validator",
        "//ortools/math_opt:model_cc_proto",
        "//ortools/math_opt:model_parameters_cc_proto",
        "//ortools/math_opt:sparse_containers_cc_proto",
        "//ortools/math_opt/core:math_opt_proto_utils",
        "//ortools/math_opt/core:sparse_vector_view",
        "//ortools/math_opt/validators:model_validator",
        "@abseil-cpp//absl/algorithm:container",
        "@abseil-cpp//absl/container:flat_hash_map",
        "@abseil-cpp//absl/log:check",
        "@abseil-cpp//absl/status",
        "@abseil-cpp//absl/status:statusor",
        "@abseil-cpp//absl/strings:string_view",
        "@abseil-cpp//absl/types:span",
    ],
)

cc_library(
    name = "mps_converter",
    srcs = ["mps_converter.cc"],
    hdrs = ["mps_converter.h"],
    deps = [
        ":proto_converter",
        "//ortools/base:status_macros",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/linear_solver:model_exporter",
        "//ortools/lp_data:mps_reader",
        "//ortools/math_opt:model_cc_proto",
        "@abseil-cpp//absl/status:statusor",
        "@abseil-cpp//absl/strings",
    ],
)

cc_library(
    name = "names_removal",
    srcs = ["names_removal.cc"],
    hdrs = ["names_removal.h"],
    deps = [
        "//ortools/math_opt:model_cc_proto",
        "//ortools/math_opt:model_update_cc_proto",
    ],
)

cc_library(
    name = "lp_converter",
    srcs = ["lp_converter.cc"],
    hdrs = ["lp_converter.h"],
    deps = [
        ":proto_converter",
        "//ortools/base:status_macros",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/linear_solver:model_exporter",
        "//ortools/math_opt:model_cc_proto",
        "@abseil-cpp//absl/status:statusor",
    ],
)

cc_library(
    name = "lp_parser",
    srcs = ["lp_parser.cc"],
    hdrs = ["lp_parser.h"],
    deps = [
        ":mps_converter",
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/base:path",
        "//ortools/base:status_macros",
        "//ortools/base:temp_path",
        "//ortools/gscip",
        "//ortools/linear_solver:scip_helper_macros",
        "//ortools/math_opt:model_cc_proto",
        "//ortools/util:status_macros",
        "@abseil-cpp//absl/memory",
        "@abseil-cpp//absl/status",
        "@abseil-cpp//absl/status:statusor",
        "@abseil-cpp//absl/strings",
        "@scip",
    ],
)
